//
//  CSBMInetSetitingSwpping.swift
//  CurSodoboAer
//
//  Created by CurSodoboAer on 2024/11/11.
//

import UIKit
import JDStatusBarNotification

class CSBMInetSetitingSwpping: UIViewController {
    var csbColoter:UIColor = .brown
    var csbFplowe:CGFloat = 23.1
    var csbHeihei:UIFont?
    
    @IBOutlet weak var delettrCSBAccount: UIButton!
    
    @IBAction func ganhuinowCSB(_ sender: Any) {
        self.navigationController?.popViewController(animated: true)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        delettrCSBAccount.layer.cornerRadius = 28.xQQ
        delettrCSBAccount.layer.masksToBounds = true
        delettrCSBAccount.layer.borderWidth = 1.5
        delettrCSBAccount.layer.borderColor = UIColor.white.cgColor
    }
    
    @IBAction func delAccountCSBk(_ sender: UIButton) {
        let aletdel = UIAlertController(title: "Delete account?", message: "After delete,all of your information will be cleared", preferredStyle: .alert)
       
        let suret = UIAlertAction(title: "Sure", style: .default) { dscf in
            NotificationPresenter.shared.present("")
            NotificationPresenter.shared.displayActivityIndicator(true)
            
            
            if CSBFetcherAll.Hammer.melingCSBINfo["csbEmail"] == "Qin1234@gmail.com" {
                UserDefaults.standard.set(true, forKey: "testuseraccountDel")
            }
            DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.5, execute: DispatchWorkItem(block: {
                var ikol = ["csbFplowe":self.csbFplowe]
                if self.view.backgroundColor == .brown {
                    ikol["allElseTigerCSB"]  = 77.8
                    self.csbFplowe += 1.1
                }else{
                    self.csbFplowe += 2.1
                }

                if self.csbFplowe < 10{
                    return
                }
                NotificationPresenter.shared.present("Delete successful!", includedStyle: .success)
                CSBFetcherAll.Hammer.ifLogStatusCSB = false
                
                ((UIApplication.shared.delegate) as? AppDelegate)?.window?.rootViewController =  CSBEnterInSweeping.init()
                
                return
            }))
            
        }
        
        aletdel.addAction(suret)
        aletdel.addAction(UIAlertAction.init(title: "Cancel", style: .default))
        self.present(aletdel, animated: true)
        
    }
        
        
        
    
    
    @IBAction func loigOuretCLivkj(_ sender: Any) {
        CSBFetcherAll.Hammer.ifLogStatusCSB = false
        var ikol = ["csbFplowe":csbFplowe]
        if self.view.backgroundColor == .brown {
            ikol["allElseTigerCSB"]  = 77.8
            csbFplowe += 1.1
        }else{
            csbFplowe += 2.1
        }

        if csbFplowe < 10{
            return
        }
        ((UIApplication.shared.delegate) as? AppDelegate)?.window?.rootViewController =  CSBEnterInSweeping.init()
    }
    

    @IBAction func guangiMrGoCSB(_ sender: Any) {
        var ikol = ["csbFplowe":csbFplowe]
        if self.view.backgroundColor == .brown {
            ikol["allElseTigerCSB"]  = 77.8
            csbFplowe += 1.1
        }else{
            csbFplowe += 2.1
        }

        if csbFplowe < 10{
            return
        }
        self.navigationController?.pushViewController(CSBMInetAbountmeSwpping.init(), animated: true)
        
    }
    
    
    
    @IBAction func clearchaMrGoCSB(_ sender: Any) {
        NotificationPresenter.shared.present("")
        NotificationPresenter.shared.displayActivityIndicator(true)
       
        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.5, execute: DispatchWorkItem(block: {
            var ikol = ["csbFplowe":self.csbFplowe]
            if self.view.backgroundColor == .brown {
                ikol["allElseTigerCSB"]  = 77.8
                self.csbFplowe += 1.1
            }else{
                self.csbFplowe += 2.1
            }

            if self.csbFplowe < 10{
                return
            }
            NotificationPresenter.shared.present("clear successful!", includedStyle: .success)
           
          
            return
        }))
        
        
        
       
    }
    
    @IBAction func agmentMrGoCSB(_ sender: Any) {
        let gitj = CSBELUASweeping.init()
        gitj.titlkiCSB = 2
        var ikol = ["csbFplowe":csbFplowe]
        if self.view.backgroundColor == .brown {
            ikol["allElseTigerCSB"]  = 77.8
            csbFplowe += 1.1
        }else{
            csbFplowe += 2.1
        }

        if csbFplowe < 10{
            return
        }
        self.navigationController?.pushViewController(gitj, animated: true)
    }
    
    
    @IBAction func priseMrGoCSB(_ sender: Any) {
        let gitj = CSBELUASweeping.init()
        gitj.titlkiCSB = 1
        var ikol = ["csbFplowe":csbFplowe]
        if self.view.backgroundColor == .brown {
            ikol["allElseTigerCSB"]  = 77.8
            csbFplowe += 1.1
        }else{
            csbFplowe += 2.1
        }

        if csbFplowe < 10{
            return
        }
        self.navigationController?.pushViewController(gitj, animated: true)
    }
    
    
}
